typedef long long LL;
const int mod = 1e9+7;
LL dp[40005][205];
class Solution {
public:
    int securityCheck(vector<int>& c, int k) {
        memset(dp,0,sizeof(dp));
        int n=c.size();
        dp[0][0]=1;
        for(int i=1;i<=n;i++){
            for(int j=0;j<=k;j++){
                int cur=c[i-1]-1;
                dp[i][j]=dp[i-1][j]%mod;
                if(j>=cur) dp[i][j]=(dp[i][j]+dp[i-1][j-cur]%mod)%mod;
            }
        }
        return dp[n][k]%mod;
    }
};